<script setup>
    import ShopInfo from '@/components/ShopInfo.vue';
    import useGoodsStore from '@/stores/counter.js';
    import { storeToRefs } from 'pinia';
    import {RouterLink} from "vue-router"

    const goodsStore = useGoodsStore();
    let {GoodsArr}= storeToRefs(goodsStore);
    // console.log("goodsStore:",GoodsArr.value);
</script>

<template>
    <!-- 附近店铺 -->
    <div class="nearby">
        <h3 class="nearby_title">附近店铺</h3>
        <RouterLink :to="{name:'shop',params:{id:item.id}}" v-for="(item,index) in GoodsArr" :key="index">
            <ShopInfo :item="item"/>
        </RouterLink>

    </div>
</template>

<style lang="scss" scoped>
@import '@/style/viriables.scss';
.nearby {
    &_title {
        margin: .16rem 0;
        font-size: .18rem;
        font-family: PingFangSC-Medium;
        font-weight: normal;
        line-height: .25rem;
        color: $content_fontcolor;
    }

    a {
        text-decoration: none;
    }
}
</style>